package com.hua.api.core.framework.http.response;

import com.alibaba.fastjson.JSONObject;

@SuppressWarnings("all")
public class OpenApiResponse {

    public boolean isError;
    public String resultString;
    public String errMsg;

    OpenApiResponse(){

    }

    OpenApiResponse(String resultString){
        this.resultString = resultString;
        this.isError = false;
    }

    public static OpenApiResponse of(String strs){
        return new OpenApiResponse(strs);
    }

    public static OpenApiResponse error(String errMsg){
        OpenApiResponse response = new OpenApiResponse();
        response.isError = true;
        response.errMsg = errMsg;
        return response;
    }

    public  JSONObject toJSONObject(){
        return JSONObject.parseObject(resultString);
    }



}
